076 - Cake Cut(★3)
円環なので2周させて累積和+二分探索
https://atcoder.jp/contests/typical90/submissions/60292643